<template>
  <div class="row">
    <div class="title">{{ title }}</div>
    <div class="content upload">
      <p class="tip">{{ tip }}</p>
      <div class="box">
        <slot />
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'inputCardItem',
  props: {
    // 标题
    title: {
      type: String,
      default: ''
    },
    // 提示
    tip: {
      type: String,
      default: ''
    }
  },
  data() {
    return {}
  },
  created() {},
  methods: {}
}
</script>

<style lang="scss" scoped>
// input禁用-样式
input:disabled {
  background-color: #fff;
  color: #656c74;
}
.black {
  color: #171819;
}
.disabled {
  color: #656c74;
}
.row {
  .title {
    font-family: PingFang SC Regular;
    font-size: 14px;
    font-weight: normal;
    line-height: 19px;
    letter-spacing: 0px;
    color: #171819;
  }

  .content {
    font-family: PingFang SC Regular;
    font-size: 16px;
    font-weight: normal;
    letter-spacing: 0px;
    color: #171819;
    position: relative;
    height: 38px;
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;

    // 单行省略
    .ellipsis {
      text-overflow: ellipsis;
      overflow: hidden;
      word-break: break-all;
      white-space: nowrap;
    }

    input {
      width: 270px;
    }

    &::after {
      content: '';
      width: 100%;
      height: 0.5px;
      background: #e2e7ec;
      position: absolute;
      left: 0;
      bottom: 0;
    }

    .tip {
      font-family: PingFang SC Regular;
      font-size: 14px;
      font-weight: normal;
      line-height: 19px;
      letter-spacing: 0px;
      color: #b2b8bd;
    }

    .option {
      font-family: PingFang SC Medium;
      font-size: 14px;
      font-weight: normal;
      line-height: 19px;
      letter-spacing: 0px;
      /* 蓝 */
      color: #2163e0;
      flex-shrink: 0; // 禁止自动压缩
    }

    .unit {
      font-family: PingFang SC Medium;
      font-size: 14px;
      font-weight: normal;
      line-height: 19px;
      text-align: right;
      letter-spacing: 0px;
      /* 粤商通/常规黑色 */
      color: #171819;
    }
  }

  &:last-child {
    .content {
      margin-bottom: 0;

      &::after {
        display: none !important;
        height: 40px;
      }
    }
  }
}
// 上传
.upload {
  height: auto !important;
  display: block !important;
  .title {
    font-family: PingFang SC Regular;
    font-size: 14px;
    font-weight: normal;
    line-height: 19px;
    letter-spacing: 0px;
    /* 一级标题颜色 */
    color: #171819;
  }

  .tip {
    font-family: PingFang SC Regular;
    font-size: 14px;
    font-weight: normal;
    line-height: 19px;
    letter-spacing: 0px;
    margin-top: 6px;
    /* 大灰 */
    color: #656c74 !important;
  }

  .box {
    padding: 16px 0;
  }
}

// 单选框
.radio {
  height: auto !important;
  display: block !important;

  .tip {
    font-family: PingFang SC Regular;
    font-size: 12px;
    font-weight: normal;
    line-height: 16px;
    letter-spacing: 0px;
    color: #b2b8bd;
    margin-top: 6px;
  }
  .options {
    display: flex;
    font-size: 14px;
    line-height: 28px;
    height: 38px;
  }

  label {
    flex: 1;
    display: flex;
    align-items: center;
  }
  input[type='radio'] {
    border: 0.5px solid #e2e7ec;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 8px;
  }
  input[type='radio']:checked {
    border: 6px solid #2163e0;
  }
}
</style>
